package com.sky.mapper;

import com.sky.aop.AutoFill;
import com.sky.dto.DishPageQueryDTO;
import com.sky.entity.Dish;
import com.sky.enumeration.OperationType;
import com.sky.vo.DishVO;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;
import java.util.Map;

@Mapper
public interface DishMapper {
    //多表查询:dish和category
    List<DishVO> selectAll(DishPageQueryDTO dishPageQueryDTO);

    //[新增主键返回]
    @AutoFill(OperationType.INSERT)
    Integer insert(Dish dish);

    @AutoFill(OperationType.UPDATE)
    Integer update(Dish dish);

    Dish selectById(Long id);

    Integer delete(Integer[] ids);

    List<Dish> selectByCategoryId(Long categoryId);

    Integer countByMap(Map<String, Object> map);
}
